var count = 0;

function add() {
	var top = document.getElementById("top");
	var nameLabel = document.createElement("label");
	nameLabel.innerHTML = "英文名称：";
	nameLabel.name = "namelabel_" + count;

	var name = document.createElement("input");
	name.name = "name_" + count;
	name.type = "text";

	var cnNameLabel = document.createElement("label");
	cnNameLabel.name = "cn_name_label_" + count;
	cnNameLabel.innerHTML = "中文名称：";

	var cnName = document.createElement("input");
	cnName.type = "text";
	cnName.name = "cn_name_" + count;
	count++;

	var descriptionLabel = document.createElement("label");
	descriptionLabel.innerHTML = "属性描述：";

	var description = document.createElement("textarea");

	top.appendChild(nameLabel);
	top.appendChild(name);
	top.appendChild(cnNameLabel);
	top.appendChild(cnName);
	top.appendChild(document.createElement("br"));
	top.appendChild(descriptionLabel);
	top.appendChild(description);
	top.appendChild(document.createElement("br"));
	alert(count);
}
function modifyGroup(id) {
	var group = document.getElementById("group_" + id);
	document.getElementById("modifygroup").style.display = "block";
	document.getElementById("group_name").value = group.cells[0].innerHTML;
	document.getElementById("group_cnName").value = group.cells[1].innerHTML;
	document.getElementById("group_description").innerHTML = group.cells[2].innerHTML;
	document.getElementById("group_id").value = document
			.getElementById("group_id_" + id).value;
}
function submitModify() {
	if (confirm("请你确定要修改！")) {
		document.getElementById("submit").submit();
	}
}
function cancelModify() {
	modifygroup.style.display = "none";
	document.getElementById("group_name").value = null;
	document.getElementById("group_cnName").value = null;
	document.getElementById("group_description").innerHTML = null;
}

function deleteGroup(id) {
	if (confirm("确定要删除当前组！")) {
		window.location.href = "SimpleAction?group_id=" + id
				+ "&action=ProductGroupAction&method=deleteProductGroup";
	}
}